package com.wlwx.simulator.message.inbound;

import com.wlwx.simulator.codec.CMPPCommand;
import com.wlwx.simulator.message.basic.BaseInBoundMessage;

import java.nio.ByteBuffer;

public class DeliverInBoundResponse extends BaseInBoundMessage {

    private long msgId;
    private byte result;

    public DeliverInBoundResponse() {
        super(CMPPCommand.CMPP_DELIVER_RESP_COMMAND);
    }

    @Override
    public void decode(ByteBuffer byteBuffer) {
        msgId = byteBuffer.getLong();
        result = byteBuffer.get();
    }

    @Override
    public String toString() {
        StringBuffer sb = new StringBuffer("CMPP20 DELIVER RESP : [");
        sb.append("msgId") .append(":").append(msgId ).append(",");
        sb.append("result").append(":").append(result);
        sb.append("]");
        return sb.toString();
    }
}
